#coding=utf-8
import arcpy
import json

spatial_ref = arcpy.SpatialReference(4326)
with open((r'D:\WorkData\20250712四川河流\成都\白龙江.json' ).decode('utf-8'), 'rb') as file:
    content = file.read()
data = json.loads(content)
coordsList_Top = json.loads(data['data'])['coordinates']
ArcpyPolyline_List = []
for coordsList in coordsList_Top:
    ArcpyPoint_List = [arcpy.Point(*coords) for coords in coordsList]
    ArcpyArray_List = arcpy.Array(ArcpyPoint_List)
    ArcpyPolyline = arcpy.Polyline(ArcpyArray_List, spatial_ref)
    ArcpyPolyline_List.append([ArcpyPolyline])
c_polyline = arcpy.CreateFeatureclass_management(r'D:\WorkData\20250712四川河流\shp', '白龙江.shp', 'POLYLINE',spatial_reference=spatial_ref)
cs = arcpy.da.InsertCursor(c_polyline,['SHAPE@'])
for ArcpyPolyline in ArcpyPolyline_List:
    cs.insertRow(ArcpyPolyline)
del cs